﻿<!--inherits RazorEngine.Templating.TemplateBase<CodeBuilder.Models.TemplateModels.DtoFileModel>-->
<!DOCTYPE HTML>
<html>

<head>
    <meta charset="utf-8">
    <meta name="renderer" content="webkit|ie-comp|ie-stand">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport"
        content="width=device-width,initial-scale=1,minimum-scale=1.0,maximum-scale=1.0,user-scalable=no" />
    <meta http-equiv="Cache-Control" content="no-siteapp" />
    <link rel="stylesheet" type="text/css" href="../static/h-ui/css/H-ui.min.css" />
    <link rel="stylesheet" type="text/css" href="../static/h-ui.admin/css/H-ui.admin.css" />
    <link rel="stylesheet" type="text/css" href="../lib/Hui-iconfont/1.0.8/iconfont.css" />
    <link rel="stylesheet" type="text/css" href="../static/h-ui.admin/skin/default/skin.css" id="skin" />
    <link rel="stylesheet" type="text/css" href="../static/h-ui.admin/css/style.css" />
    <title>AppInfo</title>
</head>

<body>
    <div class="page-container">
        <div class="searcharea">
            <div class="st">
                <div class="sn">应用信息</div>
                <div class="idesc">系统运行后，收集信息后的一个小时，会自动创建应用，你只要编辑修改名称即可！</div>
            </div>
            <form id="formsearch">
                <div class="searchbox">
                    <input type="button" class="btnstyle btnadd islocal" value="新增"
                    onclick="_showedit('新增单项','view.html','0','80%','80%');" />
                    <!--<div class="timearea" style="display:flex;border:1px solid #888;border-radius: 4px;">
                            <select name="timetype" style="width:120px;border:none;outline:none;text-align: center;">
                                <option value="empty">订单时间</option>
                                <option value="bdate">动账日期</option>
                                <option value="cdate">消耗日期</option>
                                <option value="odate">到期日期</option>
                            </select>
                            <input type="text" name="daterange" readonly datas="" datae="" value=""
                                style="position:relative;flex:1;outline:none;border:none;border-radius: 4px; text-align: center;"
                                id="picker_date_range">
                        </div>-->
                    <input type="text" class="inputword" name="word" placeholder="输入关键字查询" value="">
                    <input type="button" class="btnsearch" onclick="_readpagedata(1);" value="查询">
                </div>
            </form>
            <a class="btn btn-success radius r" style="line-height:1.6em;margin-top:3px"
                href="javascript:location.replace(location.href);" title="刷新"><i class="Hui-iconfont">&#xe68f;</i></a>
        </div>
        <div class="suminfo">
            <span class="idesc"></span>
        </div>
        <div class="mt-20">
            <table class="table table-border table-bordered table-bg table-hover table-sort table-responsive">
                <thead>
                    <tr class="text-c">
                        <th>应用代码</th>
                        <th>显示名称</th>
                        <th>介绍</th>
                        <th>排序</th>
                        <th>操作</th>
                    </tr>
                </thead>
                <tbody>
                </tbody>
            </table>
        </div>
        <div id="pagenumarea" class="pagenumarea"></div>
        <script type="text/html" id="templateitem">
                <% list.forEach(item=>{ %>
                <tr>
                                    <td><%:=item.appName%></td>
                                    <td><%:=item.displayName%></td>
                                    <td><%:=item.desc%></td>
                                    <td><%:=item.sort%></td>
                                    <td><a title="编辑" href="javascript:;" onclick="_showedit('编辑','view.html','<%:=item.id%>','80%','80%')" class="ml-5" style="text-decoration:none"><i class="Hui-iconfont">&#xe6df;</i></a></td>
                </tr>
                <% }) %>
            </script>
    </div>

    <!--_footer 作为公共模版分离出去-->
    <script type="text/javascript" src="../lib/jquery/1.9.1/jquery.min.js"></script>
    <script type="text/javascript" src="../lib/layer/2.4/layer.js"></script>
    <script type="text/javascript" src="../static/h-ui/js/H-ui.min.js"></script>
    <script type="text/javascript" src="../lib/jquery.contextmenu/jquery.contextmenu.r2.js"></script>
    <script type="text/javascript" src="../static/h-ui.admin/js/H-ui.admin.js"></script>
    <!--/_footer 作为公共模版分离出去-->
    <!--请在下方写此页面业务相关的脚本-->
    <!-- <script type="text/javascript" src="../lib/My97DatePicker/4.8/WdatePicker.js"></script> -->
    <!--<script type="text/javascript" src="../lib/pickerdaterange/dateRange.js"></script>
        <link rel="stylesheet" href="../lib/pickerdaterange/dateRange.css">-->

    <script type="text/javascript" src="../lib/api.js"></script>
    <link href="../lib/page.min.css" rel="stylesheet" />
    <script type="text/javascript" src="../lib/page.min.js"></script>
    <script type="text/javascript" src="../lib/template.js"></script>

    <script>

        var pageobject = null;
        var isedit = true;
        var _datalist = null;
        var extendSum = null
        $(window).ready(function () {

            _readpagedata(1);

            $(".inputword").keyup(function (event) {
                if (event.keyCode == 13) {
                    _readpagedata(1);
                }
            });
            //var dateRange = new pickerDateRange('picker_date_range', {
            //    isTodayValid: false,
            //    defaultText: '  至  ',
            //    inputTrigger: 'input_trigger_demo3',
            //    success: function (obj) {
            //        $("#picker_date_range").attr('datas', obj.startDate);
            //        $("#picker_date_range").attr('datae', obj.endDate);
            //    },
            //    clear: function () {
            //    }
            //});

        });

        function _readpagedata(page) {
            if (page == 1) {
                $("#pagenumarea").empty();
            }
            var _info = $("#formsearch").parseForm();
            _info.page = page;
            _info.size = 20;
            //if (_info.daterange) {
            //    if (_info.daterange.length > 0) {
            //        _info.sdate = $("[name=daterange]").attr('datas') + " 00:00:00";
            //        _info.edate = $("[name=daterange]").attr('datae') + " 00:00:00";
            //    }
            //}
            // _apiget('/api/app/appInfo',true,function(code,obj){
            _apipost("/api/app/appInfo/getList", true, JSON.stringify(_info), function (code, obj) {
                if (code == 200 && obj.items != null && obj.items.length > 0) {
                    var datas = obj.items;
                    _showpagedata(datas, extendSum);
                    if (pageobject == null || page == 1) {
                        pageobject = new Page({
                            el: '#pagenumarea',
                            nums: obj.totalCount,//总数
                            counts: 20,//每页大小
                            defaultPage: 1,
                            showHeadFoot: false, // 显示首页尾页
                            head: '首', // 更改首页文字
                            foot: '尾', // 更改尾页文字
                            jumpToOrder: true, // 跳转到指定页
                            showNowAndAll: true, // 当前页/共几页
                            prev: "上一页",
                            next: "下一页",
                            clickEvent: function (currectPage, _this) {
                                _readpagedata(currectPage);
                            }
                        });
                    }
                }
            });
        }

        function _showpagedata(datas, total) {
            _datalist = datas;
            var _ahtml = $("#templateitem").html();
            var _heml = template(_ahtml, { list: datas, extend: total });
            $("table").find("tbody").html(_heml);
        }
    </script>
</body>

</html>